import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// 导入 path 模块
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  // 设置路径别名
  resolve:{
    alias:{
      "@":path.resolve(__dirname,"src")
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://api.jjcto.com/',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    }
  },
})
